local Lua__mulizhanhao = fk.CreateSkill {

  name = "Lua__mulizhanhao",

}

Fk:loadTranslationTable{

    ["Lua__mulizhanhao"] = "目力战吼",
    ["$Lua__mulizhanhao1"] = "怨！",
    ["$Lua__mulizhanhao2"] = "你是一个！一个一个一个！",
    [":Lua__mulizhanhao"] = "当你进入濒死状态时，你可以对相邻角色造成1点伤害，若你以此法使其即将受到致命伤害，你将体力值调整为1点；你以此法对背面朝上的角色造成的伤害改为114514点。",
}

Lua__mulizhanhao:addEffect(fk.EnterDying, {
    anim_type = "offensive",
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(Lua__mulizhanhao.name)
    end,
    on_cost = function(self, event, target, player, data)
        return player.room:askToSkillInvoke(player, {skill_name = Lua__mulizhanhao.name,})
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        -- 对相邻角色造成伤害
        local targets = {}
        for _, p in ipairs(room:getAlivePlayers()) do
            if player:getNextAlive() == p or p:getNextAlive() == player then
                table.insert(targets, p)
            end
        end
        for _, p in ipairs(targets) do
            local damage = 1
            if not p.faceup then
                damage = 114514
            end
             -- 检查是否致命伤害
             if damage >= p.hp then
                room:setPlayerProperty(player, "hp", 1)
            end
            -- 造成伤害
            local damage_data = {
                from = player,
                to = p,
                damage = damage,
                skillName = Lua__mulizhanhao.name
            }
            room:damage(damage_data)
        end
    end,
})

return Lua__mulizhanhao